/**
 * Implementacion de la clase MapObject
 */ 
#include "object.hpp"
#include "../config/config.hpp"

Object::Object(){
    this->height=0;
    this->type=HOTEL;
}

Object::Object(std::string id, std::string eId, int height, ObjectType type){
	this->id=id;
	this->setType(type);
	//TODO: Ver el tema del posicionamiento en la calle
	this->edgeId = eId;
    this->height = height;
    this->type = type;
	this->temporalWeight=-1;	 //numero bien alto para q se ubique ultimo
}
    
std::string Object::getEdgeId(){
	return this->edgeId;
}

int Object::getHeight(){
    return this->height;
}

ObjectType Object::getType(){
    return this->type;
}

void Object::setEdgeId(std::string eId){
	this->edgeId = eId;
}

void Object::setHeight(int height){
    this->height = height;
}

void Object::setType(ObjectType type){
    this->type = type;
}


Object& Object::operator=(Object &original){
	this->id=original.getId();
	this->edgeId = original.getEdgeId();
	this->type = original.getType();
    this->height = original.getHeight();
	return *this;
}

std::string Object::getId()
{
	return this->id;
}


int Object::operator==(Object &original) const{
    return (this->id == original.getId());
}

int Object::operator!=(Object &original) const{
    return (this->id != original.getId());
}

int Object::operator<(Object &original) const{
	return (this->temporalWeight < original.getTemporalWeight());
}

int Object::operator>(Object &original) const{
	return (this->temporalWeight > original.getTemporalWeight());
}

int Object::operator<=(Object &original) const{
    return (this->temporalWeight <= original.getTemporalWeight());
}

int Object::operator>=(Object &original) const{
    return (this->temporalWeight >= original.getTemporalWeight());
}

void Object::setTemporalWeight(float temporalWeight)
{
	this->temporalWeight=temporalWeight;
}

float Object::getTemporalWeight()
{
	return this->temporalWeight;
}

bool Object::hasSamePosition(Object *otherMO){
	if((this->height == otherMO->getHeight())&&(this->edgeId == otherMO->getEdgeId()))
		return true;
	return false;

}

void Object::cleanMPInfo()
{
	this->temporalWeight=-1;
}